﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using Microsoft.Phone.Data.Linq;
using Microsoft.Phone.Data.Linq.Mapping;
using System.ComponentModel;

namespace DiabitiesWindowsPhoneAPP
{
    public class PersonPersonIDAndDevices
    {
        public Table<Person> person;
        public Table<Doctor> doctor;
        public Table<Devices> devices;
    }

    [Table]
    public class Person
    {
        public Person() { }
        public Person(int PersonID, string FName,
                      string LName, string Gender,
                      string DateOfBirth, float Height,
                      float Weight, float IdealWeight,
                      string DiagnosisDate, float DiabType)
        {
            personid = PersonID;
            fname = FName;
            lname = LName;
            gen = Gender;
            dob = DateOfBirth;
            ht = Height;
            wt = Weight;
            idealwt = IdealWeight;
            diadate = DiagnosisDate;
            diabtype = DiabType;
        }
        int _personid;
        string _fname;
        string _lname;
        string _gen;
        string _dob;
        float _ht;
        float _wt;
        float _idealwt;
        string _diadate;
        float _diabtype;
        [Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]

        public int personid
        {
            get { return _personid; }
            set { _personid = value; }
        }
        [Column]
        public string fname
        {
            get { return _fname; }
            set { _fname = value; }
        }
        [Column]
        public string lname
        {
            get { return _lname; }
            set { _lname = value; }
        }
        [Column]
        public string gen
        {
            get { return _gen; }
            set { _gen = value; }
        }
        [Column]
        public string dob
        {
            get { return _dob; }
            set { _dob = value; }
        }
        [Column]
        public float ht
        {
            get { return _ht; }
            set { _ht = value; }
        }
        [Column]
        public float wt
        {
            get { return _wt; }
            set { _wt = value; }
        }
        [Column]
        public float idealwt
        {
            get { return _idealwt; }
            set { _idealwt = value; }
        }
        [Column]
        public string diadate
        {
            get { return _diadate; }
            set { _diadate = value; }
        }
        [Column]
        public float diabtype
        {
            get { return _diabtype; }
            set { _diabtype = value; }
        }

    }


    [Table]
    public class Doctor
    {

        public Doctor() { }
        public Doctor(int DoctorID, string FName,
                      string LName, string OfficeName,
                      string Email, float Phone, string Role)
        {
            docid = DoctorID;
            docfname = FName;
            doclname = LName;
            offname = OfficeName;
            docemail = Email;
            docph = Phone;
            docrole = Role;
        }

        int _docid;
        string _docfname;
        string _doclname;
        string _offname;
        string _docemail;
        float _docph;
        string _docrole;

        [Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
        public int docid
        {
            get { return _docid; }
            set { _docid = value; }
        }
        [Column]
        public string docfname
        {
            get { return _docfname; }
            set { _docfname = value; }
        }
        [Column]
        public string doclname
        {
            get { return _doclname; }
            set { _doclname = value; }
        }
        [Column]
        public string docoffname
        {
            get { return _docoffname; }
            set { _docoffname = value; }
        }
        [Column]
        public string docemail
        {
            get { return _docemail; }
            set { _docemail = value; }
        }
        [Column]
        public float docph
        {
            get { return _docph; }
            set { _docph = value; }
        }
        [Column]
        public string docrole
        {
            get { return _docrole; }
            set { _docrole = value; }
        }
    }


    [Table]
    public class Devices
    {

        public Devices() { }
        public Devices(int DeviceID, string Name, string Manufacturer)
        {
            devid = DeviceID;
            devname = Name;
            manu = Manufacturer;
        }

        int _devid;
        string _devname;
        string _manu;

        [Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]

        public int devid
        {
            get { return _devid; }
            set { _devid = value; }
        }
        [Column]
        public string devname
        {
            get { return _devname; }
            set { _devname = value; }
        }
        [Column]
        public string manu
        {
            get { return _manu; }
            set { _manu = value; }
        }
    }
}